package com.exam.pojo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;
import java.io.Serializable;
import java.util.Map;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.alibaba.excel.metadata.BaseRowModel;
import org.apache.poi.ss.usermodel.CellStyle;

/**
 * <p>
 * 
 * </p>
 *
 * @author XiaoKai
 * @since 2021-07-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_user")
@ApiModel(value="User对象", description="")
public class User extends BaseRowModel implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelIgnore
    @ExcelProperty(value = "id", index = 0)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelProperty(value = "学号", index = 1)
    @ApiModelProperty(value = "学号")
    private String account;

    @ExcelProperty(value = "密码", index = 2)
    @ApiModelProperty(value = "密码")
    private String password;

    @ExcelProperty(value = "姓名", index = 3)
    @ApiModelProperty(value = "姓名")
    private String name;

    @ExcelProperty(value = "性别", index = 4)
    @ApiModelProperty(value = "性别")
    private String sex;

    @ExcelProperty(value = "电话", index = 5)
    @ApiModelProperty(value = "电话")
    private String tel;

    @ExcelProperty(value = "邮箱", index = 6)
    @ApiModelProperty(value = "邮箱")
    private String email;

    @ExcelProperty(value = "专业", index = 7)
    @ApiModelProperty(value = "专业")
    private String major;

    @ExcelProperty(value = "创建时间", index = 8)
    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time",fill = FieldFill.INSERT) //通过handler(处理器)自动填充,要在MyMateObjectHandler配置
    private Date createTime;

    @ExcelProperty(value = "跟新时间", index = 9)
    @ApiModelProperty(value = "跟新时间")
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ExcelProperty(value = "是否激活", index = 10)
    @ApiModelProperty(value = "是否激活")
    private String active;

    @ExcelProperty(value = "所属部门", index = 11)
    @ApiModelProperty(value = "所属部门")
    private Integer departmentId;

    @ExcelProperty(value = "权限等级", index = 12)
    @ApiModelProperty(value = "权限等级")
    private String ranked;

    @TableField(exist = false)
    private Map<Integer, CellStyle> cellStyleMap;

}
